const Student=require('./student');
const Teacher=require('./teacher');
class Class{
    constructor(number){
        this.number = number;
    }
    getDisplayName(){
        return `Class ${this.number}`;
    }
    assignLeader(student){
        if(this.number === student.klass.number){
            this.leader = student;
        }
        else{
            console.log(`It is not one of us.`) ;
        }
    }
    appendMember(student){
        student.klass =this;
        this.member = student;      
    }
    registerAssignLeaderListener(teacher){
        
        console.log(`I am ${teacher.name}. I know ${this.leader.name} become Leader of Class ${this.leader.klass.number}.`);
        
    }
    registerJoinListener(teacher){
        console.log(`I am ${teacher.name}. I know ${this.member.name} has joined Class ${this.member.klass.number}.`)
        
        
    }
}
module.exports=Class;



